<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ec="http://www.b2cexpress.com.br/ecommerce"
    	xmlns:s="http://www.suricattus.com.br/jsf/ui"
		xmlns:sf="http://www.suricattus.com.br/jsf/fn"
    	xmlns:composite="http://java.sun.com/jsf/composite">
    	
	<composite:interface>
		<composite:attribute name="item" type="br.com.b2cexpress.ecommerce.domain.dto.item.ItemDto" required="true" />
		<composite:attribute name="renderVideo" required="false" default="true" />
	</composite:interface>
	
	<composite:implementation>
		<div class="span4">
			<h:panelGroup id="pnl" styleClass="produto" >
				<h:link outcome="pretty:detalharItem">
					<f:param name="id" value="#{cc.attrs.item.item.id}" />
					<f:param name="nome" value="#{cc.attrs.item.item.tituloSemAcento}" />
					<img src="#{cc.attrs.item.item.icone.link}" class="imagem-home" /><br />
					<div class="detalhe">
						<p class="nome">
							<h:outputText value="#{cc.attrs.item.item.titulo}" />
						</p>
					</div>
				</h:link>
				<div class="detalhe">
					<h:panelGroup rendered="#{cc.attrs.item.item.tipoItem.id != 1 or !cc.attrs.item.item.grupoProduto.isGrupoSeguro()}">
						<h:panelGroup rendered="#{cc.attrs.item.valorDe ne null}">
	                              <p class="preco-de">
	                              	<h:outputText value="#{labels['label.de']} " />
								<h:outputText value="#{cc.attrs.item.valorDe}" styleClass="preco-de-riscado" >
									<f:convertNumber currencySymbol="R$" type="currency" maxFractionDigits="2"/>
								</h:outputText>
	                              </p>
	                             	<p class="preco-por">
	                              	<h:outputText value="#{labels['label.por']} " />
								<h:outputText value="#{cc.attrs.item.valorPor}" >
									<f:convertNumber currencySymbol="R$" type="currency" maxFractionDigits="2"/>
								</h:outputText>
	                             	</p>
						</h:panelGroup>
						<h:panelGroup rendered="#{cc.attrs.item.valorDe eq null}">
							<p class="preco">
								<h:outputText value="#{cc.attrs.item.item.valorPor}">
									<f:convertNumber currencySymbol="R$" type="currency" maxFractionDigits="2" />
								</h:outputText>
							</p>
						</h:panelGroup>
	            	</h:panelGroup>
                    <ec:informacoesComerciais item="#{cc.attrs.item}" />
				</div>
				<div class="botoes">
					<h:link outcome="pretty:detalharItem" styleClass="btn btn-small btn-primary">
						<f:param name="id" value="#{cc.attrs.item.item.id}" />
						<f:param name="nome" value="#{cc.attrs.item.item.tituloSemAcento}" />
						<i class="icon-plus icon-white" />
                       	<h:outputText value="#{labels['label.detalhes']}" rendered="#{not cc.attrs.item.item.grupoProduto.isGrupoSeguro()}" />
                       	<h:outputText value="#{labels['botao.simular']}" rendered="#{cc.attrs.item.item.grupoProduto.isGrupoSeguro()}" />
					</h:link>
					
					<h:panelGroup rendered="#{renderVideo and cc.attrs.item.item.urlVideo ne null}">
						&nbsp;
						<p:commandLink action="#{pesquisaController.selecionarItem(cc.attrs.item)}" oncomplete="dlgVideo.show();" 
								update="@form" styleClass="btn btn-small btn-primary">
							<i class="icon-film icon-white" />
                              	<h:outputText value=" #{labels['botao.ver.video']}"/>
						</p:commandLink>
					</h:panelGroup>
				</div>
			</h:panelGroup>
		</div>
	</composite:implementation>
	
</html>
